package com.zhao.facade;

import com.zhao.subSystem.AirCondition;
import com.zhao.subSystem.Light;
import com.zhao.subSystem.TV;
import javafx.application.Application;

public class ApplicationFacade {

    private TV tv;

    private Light light;

    private AirCondition airCondition;

    public ApplicationFacade() {
        tv = new TV();
        light = new Light();
        airCondition = new AirCondition();
    }

    public void say(String message) {
        if (message.contains("打开")) {
            on();
        } else if (message.contains("关闭")){
            off();
        } else {
            System.out.println("无法识别语音");
        }
    }

    public void on() {
        tv.on();
        light.on();
        airCondition.on();
    }

    public void off() {
        tv.off();
        light.off();
        airCondition.off();
    }
}
